<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>交换变量</title>
</head>

<body>
    <script>
        let left = "小黄";
        let right = "小白";
        table = left;
        left = right;
        right = table;
        console.log(left, right);

        let top1 = "苹果";
        let bottom = "榴莲";
        table = top1;
        top1 = bottom;
        bottom = table;
        console.log(top1, bottom);


        let black = "老大";
        let white = "老二";
        table = black;
        black = white;
        white = table;
        console.log(black, white);
    </script>
</body>

</html>